package rexsee.multimedia;

import rexsee.core.browser.Browser;
import rexsee.core.widget.DivDialog;
import android.view.SurfaceHolder;
import android.view.SurfaceView;
import android.widget.FrameLayout;

public class SurfaceDialog extends DivDialog {

	public SurfaceView surfaceView = null;

	public SurfaceDialog(Browser browser, String style) {
		super(browser, null, style);
	}

	public void start(SurfaceHolder.Callback callback) {
		super.start();
		surfaceView = new SurfaceView(mContext);
		surfaceView.getHolder().addCallback(callback);
		surfaceView.getHolder().setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
		surfaceView.getHolder().setFixedSize(FrameLayout.LayoutParams.FILL_PARENT, FrameLayout.LayoutParams.FILL_PARENT);
		surfaceView.setFocusable(true);
		surfaceView.setFocusableInTouchMode(true);
		surfaceView.requestFocus();
		surfaceView.requestLayout();
		surfaceView.invalidate();
		this.addChild(surfaceView);
	}

}
